package me.yushuai.wukong.base;

import me.yushuai.wukong.common.swagger.SwaggerConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * 基础服务启动类
 *
 * @author zhoushuai@189.cn
 * @since 2022/8/18
 */
@EnableSwagger2
@Import(SwaggerConfig.class)
@EnableTransactionManagement
@EntityScan("me.yushuai.wukong.base.entity")
@SpringBootApplication(scanBasePackages = "me.yushuai.wukong")
public class BaseBootstrap
        implements CommandLineRunner {

    @Value("${spring.application.name}")
    private String appName;

    public static void main(String[] args) {
        SpringApplication.run(BaseBootstrap.class, args);
    }

    @Override
    public void run(String... args) {
        System.out.println("微服" + appName + "启动成功！");
    }
}
